package com.hongyun.tms.common.dto.prodplan;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 拖轮计费 参数
 *
 * @author liPeng
 * @date 2024-05-31
 **/
@Data
public class TugCalculateFeeReqDto implements Serializable {

    @ApiModelProperty(value = "作业记录id")
    @NotNull(message = "至少选择一条记录")
    private Long id;

    @ApiModelProperty(value = "开始时间")
    @NotBlank(message = "作业开始时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private String beginTime;

    @ApiModelProperty(value = "结束时间")
    @NotBlank(message = "作业结束时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private String endTime;

    @ApiModelProperty(value = "油耗")
//    @NotNull(message = "油耗不能为空")
    @DecimalMin(value = "0", message = "油耗不能小于0")
    @DecimalMax(value = "99999.99", message = "油耗最大可输入99999.99")
    private BigDecimal oilConsume;

    @ApiModelProperty(value = "里程")
//    @NotNull(message = "里程不能为空")
    @DecimalMin(value = "0", message = "里程不能小于0")
    @DecimalMax(value = "99999.99", message = "里程最大可输入99999.99")
    private BigDecimal distance;

    @ApiModelProperty("完工时计费，需要上传的附件列表，格式：  [123, 234],即id数组")
    @NotEmpty(message = "附件不能为空")
    private List<Long> attachList = Lists.newArrayList();
}

